﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Project_NhomMua_B4.Controllers
{
    public class UserInfoController : Controller
    {
        //
        // GET: /UserInfo/
        string[] theme1 = new string[]{"~/Content/UserThemes/t1/login.css","~/Content/UserThemes/t1/mainMP.css",
            "~/Content/UserThemes/t1/main.css","~/Content/UserThemes/t1/ttcn.css"};
        string[] theme2 = new string[] { "~/Content/UserThemes/t2/login.css", "~/Content/UserThemes/t2/mainMP.css",
            "~/Content/UserThemes/t2/main.css", "~/Content/UserThemes/t2/ttcn.css" };

        public ActionResult Index()
        {
            ViewBag.partial = "_ttcn";
            ViewBag.active = 1;
            TempData["theme"] = theme1;
            ViewBag.cssLink = TempData.Peek("theme");
            return View();
        }

        public ActionResult DislayView(string name)
        {
            string theme = Request.Form["choosethemes"];
            if (theme != null)
            {
                TempData["theme"] = (theme == "theme1") ? theme1 : theme2;                
            }
            ViewBag.cssLink = TempData.Peek("theme");
            switch (name)
            {
                case "ttdh":
                    {
                        ViewBag.partial = "_ttdh";
                        ViewBag.active = 2;
                    } break;
                case "hdd":
                    {
                        ViewBag.partial = "_hdd";
                        ViewBag.active = 1;
                    } break;
                case "ttcn":
                    {
                        ViewBag.partial = "_ttcn";
                        ViewBag.active = 1;
                    } break;
                case "tthv":
                    {
                        ViewBag.partial = "_tthv";
                        ViewBag.active = 1;
                    } break;
                case "ttst":
                    {
                        ViewBag.partial = "_ttst";
                        ViewBag.active = 1;
                    } break;
                case "ttlh":
                    {
                        ViewBag.partial = "_ttlh";
                        ViewBag.active = 1;
                    } break;
                default:
                    {
                        ViewBag.partial = "_ttcn";
                        ViewBag.active = 1;
                    } break;
            }
            return View("DislayView");
        }
    }
}
